#include <cstdio>
#include <cstring>
#include <assert.h>
#include <boundary.h>

CBoundary::CBoundary(int Type, FILE* flog)
{

	this->Type = Type;
	this->flog = flog;
}
CBoundary::CBoundary(CBoundary *boundary)
{
	this->Type = boundary->type();
	this->flog = boundary->flog;
	BC_t BCtemp = boundary->GetBC(0.);
	BC = BCtemp;
	// BC.eps = BCtemp.eps;
	// BC.Tw = BCtemp.Tw;
	// BC.Te = BCtemp.Te;
	// BC.al = BCtemp.al;
}
int CBoundary::type()
{
	return this->Type;
}
CSOBoundary::CSOBoundary(double al, double Te, double q, double eps) : CBoundary(2, stdout)
{
	assert(Te >= 0.);
	BC.al = al;
	BC.Te = Te;
	BC.q = q;
	BC.eps = eps;
	BC.Tw = -1.;
}
BC_t CSOBoundary::GetBC(double Time) {

	return BC;
}

void CSOBoundary::print() {
	printf("\nEPS, TE, AL\n");
	printf("eps=%5.3lf\tIe=%lf\tacp=%lf\n", BC.eps, BC.Te, BC.al);
	return;
}
int CSOBoundary::SetTimeChangeCoefs(const char* pname, const func_points_t* table)
{
	assert(0);
	return NULL_VALUE;
}
CFOBoundary::CFOBoundary(double Tw, FILE* flog) : CBoundary(1, flog)
{
	BC.Tw = Tw;
	BC.eps = -1.;
	BC.Te = -1.;
	BC.al = -1.;
}
BC_t CFOBoundary::GetBC(double Time) {

	return BC;
}

void CFOBoundary::print() {
	printf("Tw=%lf\n", BC.Tw);
}
int CFOBoundary::SetTimeChangeCoefs(const char* pname, const func_points_t* table)
{
	assert(0);
	return NULL_VALUE;
}

